package fr.imag.ufrima.ima.project.ui.component;

import java.awt.FlowLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class StatusBar extends JPanel {
	
	private JLabel coorX;
	private JLabel valXc;
	private JLabel coorY;
	private JLabel valYc;
	private JLabel red;
	private JLabel valRed;
	private JLabel green;
	private JLabel valGreen;
	private JLabel blue;
	private JLabel valBlue;
	private JLabel y;
	private JLabel valY;
	private JLabel u;
	private JLabel valU;
	private JLabel v;
	private JLabel valV;
	
	public StatusBar(){
		createInterface();
	}
	
	public void createInterface(){
		
		setLayout(new FlowLayout(FlowLayout.LEFT));
		
		coorX = new JLabel("Coordonnees || x :");
		add(coorX);
		valXc = new JLabel("");
		add(valXc);
		coorY = new JLabel(" y :");
		add(coorY);
		valYc = new JLabel("");
		add(valYc);
		red = new JLabel("|| R :");
		add(red);
		valRed = new JLabel("");
		add(valRed);
		green = new JLabel(" G :");
		add(green);
		valGreen = new JLabel("");
		add(valGreen);
		blue = new JLabel(" B :");
		add(blue);
		valBlue = new JLabel("");
		add(valBlue);
		y = new JLabel("|| Y :");
		add(y);
		valY = new JLabel("");
		add(valY);
		u = new JLabel(" U :");
		add(u);
		valU = new JLabel("");
		add(valU);
		v = new JLabel(" V :");
		add(v);
		valV = new JLabel("");
		add(valV);
	}
	
	/**
	 * Change the coordonnees x and y on the status bar
	 * @author lancelog
	 * @param x the new x coordonnee
	 * @param y the new y coordonnee
	 */
	public void setCoordonnees(String x, String y){
		valXc.setText(x);
		valYc.setText(y);
	}
	
	/**
	 * Change the RGB values on the status bar
	 * @author lancelog
	 * @param r
	 * @param g
	 * @param b
	 */
	public void setRGB(String r, String g, String b){
		valRed.setText(r);
		valGreen.setText(g);
		valBlue.setText(b);
	}
	
	/**
	 * Change the YUV values on the status bar
	 * @author lancelog
	 * @param y
	 * @param u
	 * @param v
	 */
	public void setYUV(String y, String u, String v){
		valY.setText(y);
		valU.setText(u);
		valV.setText(v);
	}
	
}
